<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<p>
			call 传递的参数是一个一个写，apply 穿的参数必须方向在数组里
		</p>

	</body>
</html>

<script type="text/javascript">
	function aaa(name, age) {
		this.name = name,
			this.age = age
	}

	function bbb(sex, job) {
		this.sex = sex,
			this.job = job
	}

	function ccc(name, age, sex, job) {
		aaa.call(this, name, age)
		bbb.apply(this, [sex, job])
		console.log(name + '-' + age + '-' + sex + '-' + job)
	}

	var c1 = new ccc('姓名', '年龄', '性别', '工作')

	class ddd {
		constructor(d) {
			this.d = d
		}
		ddd_1() {
			console.log('ddd_1');
		}
	}
	let dddd = new ddd()
	class eee {
		constructor(e, ee) {
			(new ddd()).call(this, ee)
			this.e = e
		}
		eee_1() {
			console.log(this.e, this.d);
		}
	}
	let eeee = new eee(11, 22)
	eeee.eee_1()
</script>
